﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Omniture.API;

namespace Omniture.Studio.Objects
{
	public static class Extensions
	{
		public static ListViewItem[] ToArray(this ListView.SelectedListViewItemCollection list)
		{
			var retval = new List<ListViewItem>();
			foreach (ListViewItem item in list)
			{
				retval.Add(item);
			}
			return retval.ToArray();
		}

		public static void SelectAll(this ListView list)
		{
			foreach (ListViewItem item in list.Items)
			{
				item.Selected = true;
			}
		}

		public static void UnSelectAll(this ListView list)
		{
			foreach (ListViewItem item in list.Items)
			{
				item.Selected = false;
			}
		}

	}

	public class ListViewItemITrack : ListViewItem
	{
		public ITrackItem TrackItem { get; set; }

		public ListViewItemITrack()
			: base()
		{
		}

		public ListViewItemITrack(string text)
			: base(text)
		{
		}
}

	public class ListViewItemPageItem : ListViewItem
	{
		public PageItem PageItem { get; set; }

		public ListViewItemPageItem()
			: base()
		{
		}

		public ListViewItemPageItem(string text)
			: base(text)
		{
		}

	}

}
